package chapterfour;

/**
 * Created by Think on 2016/3/18.
 */
import java.util.Arrays;
public class CopyArray {
    public static void main(String[] args){
        int[] scores1={88,81,75,69,74,34,54,27,98,96};
        int[] scores2=Arrays.copyOf(scores1,scores1.length);
        for(int score:scores2) {
            System.out.printf("%3d",score);
        }
        System.out.println();
        scores2[0]=99;//不影响score1参考的数组对象
        for(int score:scores1){
            System.out.printf("%3d",score);
        }
    }
}
